
getX :: Int -> Int
getX i
	| i == 0 = 1
	| i < 18 = 0
	| otherwise  = ((getX(i+7-18)) + (getX(i-18))) `mod` 2

getY::Int->Int
getY 0 = 1
getY 1 = 1
getY 2 = 1
getY 3 = 1
getY 4 = 1
getY 5 = 1
getY 6 = 1
getY 7 = 1
getY 8 = 1
getY 9 = 1
getY 10 = 1
getY 11 = 1
getY 12 = 1
getY 13 = 1
getY 14 = 1
getY 15 = 1
getY 16 = 1
getY 17 = 1
getY i = ((getY (i+10-18)) + (getY (i+7-18)) + (getY (i+5-18)) + (getY (i-18))) `mod` 2


getZ :: Int -> Int -> Int
getZ n i = (getX ((i+n) `mod` (2^18-1)) + (getY i)) `mod` 2
